# -*- encoding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution    
#    Copyright (C) 2003-2010 NS-Team (<http://www.ns-team.fr>). All Rights Reserved
#    $Id$
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import jasper_reports
from osv import osv,fields 
import pooler 
import datetime
from mx import DateTime

def kderp_list_of_supplier_payment( cr, uid, ids, data, context):
    cr.execute("Select id from kdvn_request_of_payment where state = 'completed' ")
    
    kderprp_ids = []
    for idss in cr.fetchall():
        kderprp_ids.append(idss[0])
    
    data['ids']=kderprp_ids
    data['id'] = kderprp_ids[0]
    
    return {'ids':kderprp_ids}
jasper_reports.report_jasper(
   'report.kderp.report.list.of.supplier.payment.xls',
   'kdvn.request.of.payment',
   parser=kderp_list_of_supplier_payment
)